﻿using ProjectGamer.DataModels;
using ProjectGamer.Web.DbAdapters.Adapters;
using ProjectGamer.Web.DbAdapters.IAdapters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace ProjectGamer.Web.Controllers
{
    //[RoutePrefix]
    public class AzController : ApiController
    {
        IAzAdapter _adapter = new AzAdapter();

        // GET api/az
        public IHttpActionResult Get()
        {
            List<AzGame> azGames = _adapter.GetAllGames();
            return Ok(azGames);
        }

        [ActionName("search")]
        public IHttpActionResult Get(string id)
        {
            List<AzGame> azGames = _adapter.GameSearch(id);
            return Ok(azGames);
        }

        [ActionName("bykey")]
        public IHttpActionResult Get2(string id)
        {
            AzGame azGame = _adapter.GetGameById(id);
            return Ok(azGame);
        }

        
    }
}
